from google.appengine.ext import db

class Document(db.Model):

    postedby = db.UserProperty()
    title = db.StringProperty()
    summary = db.StringProperty()
    location = db.LinkProperty()
    imagelink = db.LinkProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    categories = db.StringListProperty()
    published = db.BooleanProperty(False)
    format = db.StringProperty(default='pdf')
    pages = db.IntegerProperty()
    commentcount = db.IntegerProperty(default=0)

#    def getAllowedCategories(self):
#        return ['Budgeting', 'Food Planning', 'Recipes', 'Newsletter']

    def getKey(self):
        return self.key()

    def isValid(self):
        return True


